<template>
    <div
        class="ChangeCard"
        v-loading="pageLoading"
        element-loading-background="rgba(255, 255, 255, 0.7)"
    >
        <el-card class="box-card">
            <div slot="headerss" class="clearfix text_fl">
                <span>公共服务类-->换卡</span>
                <el-button class="btn_close" type="text" @click="handleClose">关闭</el-button>
            </div>
            <div>
                <div v-show="!isChangeCardSuccess">
                    <el-form ref="formData" :model="formData" :rules="rules" label-width="150px">
                        <el-row>
                            <el-col :span="10" :offset="1">
                                <div class="text_center width30">
                                    <el-form-item label="账户类别:" class="text_fl">
                                        <el-select
                                            v-model="formData.CATEGORY"
                                            placeholder="请选择账户类别"
                                            @change="getCATEGORYObj"
                                        >
                                            <el-option
                                                v-for="item in AccountionTYPE_INFO"
                                                :label="item.label"
                                                :value="item.code"
                                                :key="item.code"
                                            ></el-option>
                                        </el-select>
                                    </el-form-item>
                                </div>
                            </el-col>
                            <el-col :span="12">
                                <div class="text_center width30">
                                    <el-form-item label="卡号:" class="text_fl">
                                        <el-select
                                            v-model.trim="formData.CARDNO"
                                            placeholder="请选择卡号"
                                            @change="getCARDNBRFun"
                                        >
                                            <el-option
                                                v-for="item in cardList_option"
                                                :label="item.CARDNBR"
                                                :value="item.CARDNBR"
                                                :key="item.CARDNBR"
                                            ></el-option>
                                        </el-select>
                                    </el-form-item>
                                </div>
                            </el-col>
                            <!-- <el-col :span="10" :offset="1">
                                <div class="text_center width30">
                                    <el-form-item label="账户类别:" class="text_fl">
                                        <el-input :disabled="true" v-model="CATEGORY_filter"></el-input>
                                    </el-form-item>
                                </div>
                            </el-col>
                            <el-col :span="12">
                                <div class="text_center width30">
                                    <el-form-item label="卡号:" class="text_fl">
                                        <el-input :disabled="true" v-model="formData.CARDNO"></el-input>
                                    </el-form-item>
                                </div>
                            </el-col>-->
                        </el-row>
                        <el-row>
                            <el-col :span="10" :offset="1">
                                <div class="text_center width30">
                                    <el-form-item label="换卡原因:" class="text_fl" prop="ISSRSN">
                                        <el-select
                                            v-model="formData.ISSRSN"
                                            placeholder="请选择递卡方式"
                                            clearable
                                        >
                                            <el-option
                                                v-for="item in ISSRSNOptionData"
                                                :label="item.label"
                                                :value="item.code"
                                                :key="item.id"
                                            ></el-option>
                                        </el-select>
                                    </el-form-item>
                                </div>
                            </el-col>
                            <el-col :span="12">
                                <div class="text_center width30">
                                    <el-form-item
                                        label="凸字姓名(姓/名/):"
                                        class="text_fl"
                                        prop="EMBNAME"
                                    >
                                        <el-input
                                            v-model="formData.EMBNAME"
                                            class="textSpan"
                                            placeholder=" 姓/名/"
                                        ></el-input>
                                    </el-form-item>
                                </div>
                            </el-col>
                        </el-row>
                        <el-row>
                            <!-- <el-col :span="10" :offset="1">
                                <div class="text_center width30">
                                    <el-form-item label="是否保留卡号:" class="text_fl" prop="KEEPYN">
                                        <el-select
                                            v-model="formData.KEEPYN"
                                            placeholder="请选择递卡地址类型"
                                            @change.native="changeYn"
                                            clearable
                                        >
                                            <el-option
                                                v-for="item in isKEEPYNOption"
                                                :label="item.label"
                                                :value="item.code"
                                                :key="item.id"
                                            ></el-option>
                                        </el-select>
                                    </el-form-item>
                                </div>
                            </el-col>-->
                            <!-- <el-col :span="10" :offset="1">
                                <div class="text_center width30">
                                    <el-form-item label="到期日(YY-MM):" class="text_fl">
                                        <span
                                            class="el-form-item-span"
                                        >{{formData.EXPIRE | filterDateYYMM}}</span>
                                    </el-form-item>
                                    <el-form-item label="到期日:" class="text_fl">
                                      <el-date-picker
                                      v-model="formData.EXPIRE"
                                      type="month"
                                      format="yy-MM"
                                      value-format="yymm"
                                      placeholder="YYMM"></el-date-picker>
                                    </el-form-item>
                                </div>
                            </el-col>-->
                            <el-col :span="10" :offset="1">
                                <div class="text_center width30">
                                    <el-form-item label="递卡方式:" class="text_fl" prop="REPLACEFEE">
                                        <el-select
                                            v-model="formData.REPLACEFEE"
                                            placeholder="请选择递卡方式"
                                            clearable
                                            @change="componentCostFun"
                                        >
                                            <el-option
                                                v-for="item in isREPLACEFEEOption"
                                                :label="item.label"
                                                :value="item.code"
                                                :key="item.label"
                                            ></el-option>
                                        </el-select>
                                    </el-form-item>
                                </div>
                            </el-col>
                            <el-col :span="12">
                                <div class="text_center width30">
                                    <el-form-item label="卡片递送地址类型:" class="text_fl">
                                        <span class="el-form-item-span">{{formData.CARDTO}}</span>
                                        <!-- <el-select
                                            v-model="formData.CARDTO"
                                            placeholder="请选择递卡地址类型"
                                            clearable
                                            disabled
                                        >
                                            <el-option
                                                v-for="item in isCARDTOOption"
                                                :label="item.label"
                                                :value="item.code"
                                                :key="item.label"
                                            ></el-option>
                                        </el-select>-->
                                    </el-form-item>
                                </div>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="10" :offset="1">
                                <div class="text_center width30">
                                    <el-form-item label="补卡费用:" class="text_fl">
                                        <el-input :disabled="true" v-model.trim="COST_value"></el-input>
                                    </el-form-item>
                                </div>
                            </el-col>

                            <el-col :span="12">
                                <div class="text_center width30">
                                    <el-form-item label="补卡换卡次数:" class="text_fl">
                                        <el-input :disabled="true" v-model="formData.ISSUENBR"></el-input>
                                    </el-form-item>
                                </div>
                                <!-- <div class="text_center width30">
                                    <el-form-item label="换卡费用:" class="text_fl" prop="REPLACEFEE">
                                        <el-select
                                            v-model="formData.REPLACEFEE"
                                            placeholder="请选择换卡费用"
                                            clearable
                                        >
                                            <el-option
                                                v-for="item in isREPLACEFEEOption"
                                                :label="item.label"
                                                :value="item.code"
                                                :key="item.id"
                                            ></el-option>
                                        </el-select>
                                    </el-form-item>
                                </div>-->
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="10" :offset="1">
                                <div class="text_center width30">
                                    <el-form-item label="电子现金余额:" class="text_fl">
                                        <el-input :disabled="true" v-model="BALANCE_value"></el-input>
                                    </el-form-item>
                                </div>
                            </el-col>
                            <el-col :span="12">
                                <div class="text_center width30">
                                    <el-form-item label="是否绑定ETC:" class="text_fl">
                                        <span class="el-form-item-span"></span>
                                    </el-form-item>
                                </div>
                            </el-col>
                        </el-row>

                        <div class="text_center">
                            <el-button
                                type="primary"
                                size="small"
                                @click="handerClickFormdata"
                                icon="el-icon-circle-check"
                                v-preventReClick
                            >确定</el-button>
                            <el-button
                                type="primary"
                                size="small"
                                plain
                                @click="addressEdit"
                            >客户地址信息修改</el-button>
                            <el-button
                                type="primary"
                                size="small"
                                plain
                                @click="addressEdit"
                            >发送旧卡卡号给客户</el-button>
                        </div>
                    </el-form>
                    <el-dialog
                        v-drag
                        title="换卡操作"
                        :visible.sync="centerDialogVisible"
                        width="500px"
                        :append-to-body="true"
                        top="30vh"
                        :close-on-click-modal="false"
                        center
                    >
                        <p>
                            卡号：
                            <span>{{this.formData.CARDNO}}</span>
                        </p>
                        <p>
                            卡产品：
                            <span>{{this.PRODUCT_value}}</span>
                        </p>
                        <p class="text_center padding_top15">
                            <span style="color:#3a8ee6; ">您确认要换卡吗？</span>
                        </p>
                        <span slot="footer" class="dialog-footer">
                            <el-button
                                size="small"
                                icon="el-icon-circle-close"
                                @click="centerDialogVisible = false"
                            >取 消</el-button>
                            <el-button
                                type="primary"
                                size="small"
                                @click="handerChangeCard"
                                icon="el-icon-circle-check"
                                v-preventReClick
                            >确定</el-button>
                        </span>
                    </el-dialog>
                    <el-dialog
                        v-drag
                        title="换卡操作"
                        :visible.sync="centerDialogVisibleonload"
                        width="500px"
                        :append-to-body="true"
                        top="30vh"
                        :close-on-click-modal="false"
                        center
                    >
                        <p>
                            卡号：
                            <span>{{this.formData.CARDNO}}</span>
                        </p>
                        <p class="text_center padding_top15">
                            <span style="color:#3a8ee6; ">{{errorMessage}}</span>
                        </p>
                        <span slot="footer" class="dialog-footer">
                            <el-button
                                size="small"
                                icon="el-icon-circle-close"
                                @click="handleClose"
                            >取 消</el-button>
                            <el-button
                                type="primary"
                                size="small"
                                @click="handleClose"
                                icon="el-icon-circle-check"
                                v-preventReClick
                            >确定</el-button>
                        </span>
                    </el-dialog>
                </div>
                <div v-show="isChangeCardSuccess">
                    <change-card-item
                        v-if="isChangeCardSuccess"
                        :ChangeCardSuccess="ChangeCardSuccess"
                    ></change-card-item>
                </div>
            </div>
        </el-card>
    </div>
</template>
<script>
import { mapGetters } from 'vuex';
import moment from 'moment';
import ChangeCardItem from './childItem/ChangeCardItem';
import {
    closePage,
    trimString,
    getDictSelectList,
    itoStr,
    getDictMappingValue,
    componentCost,
    setICCardInfo,
    setETCCardInfo,
    updateDeal3004,
    getCardInfo3004,
    updateDeal3601,
} from '@/utils/Common';
import { isEmptyObject } from '@/utils/Object';

export default {
    name: 'ChangeCard',
    data() {
        return {
            pageLoading: true,
            // defaultParams: this.$store.getters.defaultParams, // 请求头参数
            formData: { EMBNAME: '', },

            // 是否保留卡号下拉选
            isKEEPYNOption: [
                { code: '0', label: '不保留' },
                { code: '1', label: '保留' },
            ],
            ISSRSNOptionData: [], // 换卡原因下拉选
            isDSPCHCDOption: [], // 递卡方式 isDESPATCHOption DSPCHCD
            isCARDTOOption: [], // 卡片递送地址类型
            isREPLACEFEEOption: [], // 换卡费用代码选项
            // isCOURIERFEEOption: [], // 递送费用代码选项
            ChangeCardSuccess: {}, // 换卡成功后的信息
            centerDialogVisible: false, // 关闭弹框
            centerDialogVisibleonload: false,//
            CATEGORY_filter: '', // 账户类别
            EXPIRE_filter: '', // 到期日
            // EMBNAME_filter: '', // formData.EMBNAME
            productId: '', // 判断卡类别,
            // OtherCard_3004: '', // 主卡设置副卡时 副卡的主数据
            errorMessage: '',//页面第一次进入状态不对错误提示
            Card_STAT: '',// 卡状态
            PRODUCT_value: '', // //卡产品 在数据字典里的值
            CardStatValue: '',//卡片状态 选项

            COST_value: '0',//补卡费用 单纯用来展示 计算后的补卡费用
            BALANCE_value: '0',//电子现金余额  3096的BALANCE 值
            ETCSTATUS_value: false,//3134ETC签约关系查询交易接口
            cardtype: '',//补卡费用代码
            PRODUCT: '',//卡片产品编号
            newCardInfo_3004: '',//每次换卡的默认卡信息
            cardList_option: '',//当前账户下的所有的卡
            rules: {
                ISSRSN: [{ required: true, message: '换卡原因不能为空！', trigger: 'blur' }],
                EMBNAME: [{ required: true, message: '凸字姓名不能为空！', trigger: 'blur' }],
                // KEEPYN: [{ required: true, message: '是否保留卡号不能为空！', trigger: 'change' }],
                DSPCHCD: [{ required: true, message: '递卡方式不能为空！', trigger: 'change' }],
                // CARDTO: [
                //     { required: true, message: '卡片递送地址类型不能为空！', trigger: 'change' },
                //     { type: 'string', message: '卡片递送地址类型不能为空', whitespace: true },
                // ],
                COURIERFEE: [{ required: true, message: '递送费用不能为空！', trigger: 'change' }],
                REPLACEFEE: [{ required: true, message: '换卡费用不能为空！', trigger: 'change' }],
            },
        };
    },
    filters: {
        filterDateYYMM: (value) => {
            if (value) {
                value = moment(value, 'YYMM').format('YY-MM');
                return value;
            }
            return '';
        },
        filterCardstat: (value, CardStatValue) => {
            value = (`${value}`).trim();
            if (value === '') return '正常';
            for (let index = 0; index < CardStatValue.length; index++) {
                const element = CardStatValue[index];
                if (element.code === value) {
                    return element.label;
                }
            }
        },
    },
    computed: {
        ...mapGetters([
            'cardInfo_3004',
            'AccountionTYPE_INFO',
            'cardList_3601',
            'defaultParams',
            'pinFlag',
        ]),

        isChangeCardSuccess() {
            if (isEmptyObject(this.ChangeCardSuccess)) {
                return false;
            }
            return true;
        },
        // isCardInfo_3004() {
        //     if (this.OtherCard_3004) {
        //         return this.OtherCard_3004;
        //     }
        //     return this.cardInfo_3004;
        // },
    },
    components: {
        ChangeCardItem,
    },
    async mounted() {
        this.setDefaultCardInfo();
        // await this.getCardInfo();
        await this.isdatas();
        await this.getDictInfovalue();
        // this.onloaddata();
        this.getExecuteFun();
        this.pageLoading = false;
        // 3096IC卡交易明细查询
        setICCardInfo(this.formData.CARDNO, this);
        // 3134ETC签约关系查询交易接口
        //setETCCardInfo(this.formData.CARDNO, this);
    },
    methods: {
        // 修改默认交易
        setDefaultCardInfo() {
            // 这个方法只会调用一次
            this.pageLoading = true;
            if (!this.newCardInfo_3004) {
                this.newCardInfo_3004 = JSON.parse(JSON.stringify(this.cardInfo_3004));
            };
        },
        // 
        async getNew3004() {
            this.Card_STAT = (this.cardInfo_3004.CARDSTAT + '').trim();
            this.formData.CARDSTAT = this.newCardInfo_3004.CARDSTAT || '';// 卡片状态
            this.formData.CATEGORY = this.newCardInfo_3004.CATEGORY + ''; // 账户类别
            this.formData.CARDNO = this.newCardInfo_3004.CARDNO; // 卡号
            this.formData.CARDNBR = this.newCardInfo_3004.CARDNO; // 卡号
            this.formData.EMBNAME = this.disPoseName(this.newCardInfo_3004.EMBNAME); // 凸字姓名
            this.formData.EXPIRE = this.newCardInfo_3004.EXPIRE; // 到期日
            this.formData.COURIERFEE = `${this.newCardInfo_3004.COURIERFEE}`; // 递送费用
            this.formData.REPLACEFEE = `${this.newCardInfo_3004.REPLACEFEE}`; // 换卡费用
            this.formData.ISSUENBR = this.newCardInfo_3004.ISSUENBR; // 补卡换卡次数
            // 卡产品
            this.PRODUCT_value = await getDictMappingValue('PRODUCT', this.newCardInfo_3004.PRODUCT, this);
        },
        // 获取账户类型
        getCATEGORYObj(val) {
            console.log('val', val);
            // 获取账户类型
            this.AccountionTYPE_INFO.some(async (item) => {
                if (item.code === val) {
                    this.CATEGORY_filter = item.label;
                    return true
                }
            });
            console.log('this.CATEGORY_filter', this.CATEGORY_filter);
            //获取当前账户类型下 所有的卡 
            this.getCardListOption(val);

        },
        //获取当前账户类型下 所有的卡 
        getCardListOption(CATEGORY_val) {
            this.cardList_option = this.cardList_3601.filter((item) => (item.CATEGORY + '').trim() === CATEGORY_val);
            console.log(" this.cardList_option ", this.cardList_option);
            if (this.cardInfo_3004.CATEGORY + '' === CATEGORY_val) {
                this.formData.CARDNO = this.cardInfo_3004.CARDNO;  // 卡号
                console.log('this.formData.CARDNO', this.formData.CARDNO);
            } else {
                this.formData.CARDNO = '';
            }
        },
        // 选择 选中的需要操作的卡 后
        async getCARDNBRFun(cardNo) {
            // 选中 需要操作的卡后 需要重新跑 3004接口
            console.log("cardNo", cardNo);
            this.formData.CARDNO = cardNo;
            // 选中 需要操作的卡后 需要重新跑 3004接口
            console.log("cardNo", cardNo);
            this.formData.CARDNO = cardNo;
            // 更新 newCardInfo_3004 里的值
            await getCardInfo3004(cardNo, this);
            this.getNew3004();
        },
        // 其他页面 的卡列表里点击换卡带来默认换卡卡号 
        async getCardInfo() {
            if (this.$route.params.cardNo) {
                console.log(this.$route.params.cardNo, 'this.$route.params.cardNo 检查是否执行');
                await this.updateDeal3004(this.$route.params.cardNo);
            }
        },
        // 请求数据字典里的字段
        async getDictInfovalue() {
            // 递卡方式
            this.isDSPCHCDOption = await getDictSelectList('DSPCHCD', this);
            // 卡片状态
            this.CardStatValue = await getDictSelectList('CLOCD', this);
            // 寄送地址类型
            this.isCARDTOOption = await getDictSelectList('MAILINGADDRESS', this);

            // 换卡费用代码
            this.isREPLACEFEEOption = await getDictSelectList('REPFEE', this);
            // 递送费用代码
            // this.isCOURIERFEEOption = await getDictSelectList('COURFEE', this);
            // 换卡原因
            this.ISSRSNOptionData = await getDictSelectList('ISSRSN', this);
            // // 账户类型
            // this.CATEGORY_filter = await getDictMappingValue('CATE', this.formData.CATEGORY, this);

            // 补卡费用代码
            this.cardtype = await getDictSelectList('CARDTYPE', this);
        },
        // data 赋值
        async isdatas() {
            // await this.getIdNumber();
            // 表单赋值
            console.log(this.newCardInfo_3004.CARDNO, 'this.newCardInfo_3004.CARDNO');
            this.formData = {

                KEEPYN: '0', // 是否保留卡号
                DSPCHCD: 'POST', // this.newCardInfo_3004.DSPCHCD,//递卡方式
                // CARDTO: this.newCardInfo_3004.CARDTO, // 卡片递送地址类型
                CARDTO: '',

                ISSRSN: 'p', // 换卡原因 issrsn
                CHECKFLG: '000000000000000', // 检查项目选择
                CDFRM: 'A', // 卡片版面  必填字段 可以给四个空格 A:标准卡版面   B：彩照卡版面
                PINREQD: '0', // 是否产生PIN 1:不产生PIN 0:产生PIN
                CDISSFLAG: '0', // 即时制卡 0：否（默认）1：是
                PINFLAG: this.pinFlag,
                PIN: '',
            };
            console.log(this.formData);
            this.getNew3004();
            this.getCardListOption(this.formData.CATEGORY);
            //   this.EMBNAME_filter =this.newCardInfo_3004.EMBNAME;//凸字姓名EMBOSS-SUR
            // this.disPoseName(this.newCardInfo_3004.EMBNAME, this.newCardInfo_3004.EMBOSSSUL, this.newCardInfo_3004.EMBOSSSUR);
        },
        async getExecuteFun() {
            console.log('this.Card_STAT', this.Card_STAT);
            // 止付卡 和预期停卡 卡片 
            if (this.Card_STAT === 'H' || this.Card_STAT === "O") {
                // 判断当前卡的可用额度和信用额度是否相等
                if (this.newCardInfo_3004.CRDLIMT !== this.newCardInfo_3004.AVLIMT) {
                    this.$alert(
                        `当前客户有欠款，请还款后再致电补卡`,
                        '接口提示',
                        { customClass: 'warning', type: 'warning', showClose: false },
                    ).then(() => {
                        closePage(this.$route, this, 1);
                    });
                }
            } else if (this.Card_STAT === 'U') {
                this.$alert(
                    `当前卡片为睡眠卡，请先转为未激活状态，再进行换卡操作`,
                    '接口提示',
                    { customClass: 'warning', type: 'warning', showClose: false },
                ).then(() => {
                    closePage(this.$route, this, 1);
                });
            };

        },
        // 点击按钮验证表单信息
        handerClickFormdata() {
            //  this.dictionaries();
            this.$refs.formData.validate((valid) => {
                if (valid) {
                    this.centerDialogVisible = true;
                }
            });
        },

        // 处理 凸字姓名
        // name 凸字姓名  number 截取位数
        disPoseName(name) {
            const number = this.newCardInfo_3004.EMBOSSSUL;
            const number2 = this.newCardInfo_3004.EMBOSSSUR
            let nameValue = '';
            nameValue = name.substring(0, number - 1);
            nameValue = `${nameValue}/${name.substring(number - 1, number2)}`;
            nameValue = `${nameValue}/${name.substring(number2)}`;
            nameValue && (nameValue = (`${nameValue}`).trim());
            return nameValue;
        },
        // 发送请求 开始补卡 换卡 也是做的4025 交易
        handerChangeCard() {
            const defaultParam = JSON.parse(JSON.stringify(this.defaultParams));
            defaultParam.body.appBody = Object.assign(defaultParam.body.appBody, this.formData);
            defaultParam.body.appHead.tranCode = '4025';// 修改交易号
            defaultParam.body.appBody.EMBNAME = this.formData.EMBNAME;// 凸字姓名
            console.log(defaultParam);
            this.$post.common.transPort(defaultParam).then((res) => {
                console.log(res);
                if (res.status === 200) { // 请求成功
                    const ReissueCards = JSON.parse(res.data.jsonRes);
                    console.log(ReissueCards, 'ReissueCards');
                    if (ReissueCards.sysHead.rspCd == '000000') { // 交易成功
                        this.ChangeCardSuccess = ReissueCards;
                        this.ChangeCardSuccess.CATEGORY_filter = this.CATEGORY_filter;
                        updateDeal3004(this.cardInfo_3004.CARDNO, this);
                        updateDeal3601(this.cardInfo_3004.CARDNO, this.cardInfo_3004.KEYTYPE, this.cardInfo_3004.CUSTID, this);
                        // const successMessage = `卡号：${this.formData.CARDNBR} 换卡成功！`;
                        // const ts = `${ReissueCards.sysHead.busiName}提示`;
                        // this.$alert(successMessage, ts, {
                        //     customClass: 'success', type: 'success',
                        //     callback: (action) => {
                        //         // this.handleClose();
                        //     },
                        // });
                    } else {
                        const ErrorMessage = `错误码：${ReissueCards.sysHead.rspCd} ` + `错误信息：${ReissueCards.sysHead.rspMsg}`;
                        this.$alert(ErrorMessage, ReissueCards.sysHead.busiName, '提示', {
                            customClass: 'error', type: 'error',
                        });
                    }
                }
                this.centerDialogVisible = false; // 关闭弹框
            });
        },


        //
        addressEdit() {
            this.$router.push({ path: '/customerInfomationChange/addressEdit' });
        },
        // //主卡设置副卡时 副卡的主数据
        async updateDeal3004(cardNumber) {
            const defaultParamInfo = JSON.parse(JSON.stringify(this.defaultParams));
            defaultParamInfo.body.appHead.tranCode = '3004';// 修改交易号
            defaultParamInfo.body.appBody = {
                CARDNO: cardNumber,
                CARDNBR: cardNumber,
                PINFLAG: '',
            };
            await this.$post.common.transPort(defaultParamInfo).then((res) => {
                const IDNumData = JSON.parse(res.data.jsonRes);
                if (res.status === 200) { // 请求成功
                    console.log(IDNumData, '换卡里 3004_卡资料信息');
                    if (IDNumData.sysHead.rspCd == '000000') { // 交易成功
                        // 更新3004 不用 判断是否有新卡 传进来的卡号就是 新卡
                        this.OtherCard_3004 = IDNumData.body.appBody;
                    } else {
                        const ErrorMessage = `错误码：${IDNumData.sysHead.rspCd} ` + `错误信息：${IDNumData.sysHead.rspMsg}`;
                        this.$alert(ErrorMessage, IDNumData.sysHead.busiName, '提示', {
                            customClass: 'error', type: 'error',
                        });
                    }
                }
            });
        },
        // 下拉选 触发事件
        componentCostFun(val) {
            componentCost(val, this);
        },
        // 获取字典表格数据
        getInitData(form) {
            let params = {
                pageNum: 1,
                pageSize: 100,
            };
            let valueList;
            params = Object.assign({}, params, form);
            this.$post.Dict.searchDict(params)
                .then((res) => {
                    if (res.data.success) {
                        this.isCARDTOOption = res.data.content.dictList;
                        this.total = res.data.content.dictCount;
                    }
                    return valueList;
                });
        },
        // 点击关闭
        handleClose() {
            closePage(this.$route, this, 1);
        },
    },
};
</script>

<style lang='scss' >
.ChangeCard {
    .el-card__header {
        padding: 8px !important;
    }
    .el-form-item__content {
        text-align: left;
        // line-height: 40px;
    }
    .el-form-item-input input,
    /* .el-input input {
        width: 250px;
        min-width: 200px;
        height: 35px;
        line-height: 35px;
    } */

    .textSpan {
        width: 250px;
    }
    .el-dialog__body p {
        text-align: left;
        padding-left: 30%;
        margin: 8px 5px;
        span {
            color: #3a8ee6;
        }
    }
    .el-card.is-always-shadow {
        -webkit-box-shadow: none;
        box-shadow: none;
    }
    .el-card {
        border: none;
    }
}
</style>
